/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "cex_dia")
@NamedQueries({
    @NamedQuery(name = "CexDia.findAll", query = "SELECT c FROM CexDia c")})
public class CexDia implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "cdi_id")
    private Integer cdiId;
    @Basic(optional = false)
    @Column(name = "cdi_nombre")
    private String cdiNombre;
    @Column(name = "cdi_estado")
    private Integer cdiEstado;
    @OneToMany(mappedBy = "cexDia", fetch = FetchType.LAZY)
    private List<CexHorariosDia> cexHorariosDiaList;
    private transient boolean asignada;

    public CexDia() {
    }

    public CexDia(Integer cdiId) {
        this.cdiId = cdiId;
    }

    public CexDia(Integer cdiId, String cdiNombre) {
        this.cdiId = cdiId;
        this.cdiNombre = cdiNombre;
    }

    public Integer getCdiId() {
        return cdiId;
    }

    public void setCdiId(Integer cdiId) {
        this.cdiId = cdiId;
    }

    public String getCdiNombre() {
        return cdiNombre;
    }

    public void setCdiNombre(String cdiNombre) {
        this.cdiNombre = cdiNombre;
    }

    public Integer getCdiEstado() {
        return cdiEstado;
    }

    public void setCdiEstado(Integer cdiEstado) {
        this.cdiEstado = cdiEstado;
    }

    public List<CexHorariosDia> getCexHorariosDiaList() {
        return cexHorariosDiaList;
    }

    public void setCexHorariosDiaList(List<CexHorariosDia> cexHorariosDiaList) {
        this.cexHorariosDiaList = cexHorariosDiaList;
    }

    public boolean isAsignada() {
        return asignada;
    }

    public void setAsignada(boolean asignada) {
        this.asignada = asignada;
    }
    
    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cdiId != null ? cdiId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CexDia)) {
            return false;
        }
        CexDia other = (CexDia) object;
        if ((this.cdiId == null && other.cdiId != null) || (this.cdiId != null && !this.cdiId.equals(other.cdiId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "newpackage.CexDia[ cdiId=" + cdiId + " ]";
    }
    
}
